#! /usr/bin/python

# To change this template, choose Tools | Templates
# and open the template in the editor.

__author__ = "Neko"
__date__ = "$Dec 22, 2011 4:02:16 AM$"

print "Starting"

import random

import queVars
import wx

print "Imported"
class MainFrame(wx.Frame):
	def __init__(self):
		wx.Frame.__init__(self, None)

		mainSizer = wx.BoxSizer(wx.VERTICAL)

		addBar = wx.Button(self, wx.ID_CLOSE, "Add Gauge")
		mainSizer.Add(addBar, 0, wx.ALL, 10)
		addBar.Bind(wx.EVT_BUTTON, self.AddProgBar)
		
		
		
		self.barSizer = wx.BoxSizer(wx.HORIZONTAL)
		mainSizer.Add(self.barSizer, flag=wx.EXPAND)

		self.SetSizer(mainSizer)
		self.Layout()


	def __createSubBar(self):
		itemSizer = wx.BoxSizer(wx.VERTICAL)
		subBar = wx.Gauge(self, size=(5,20))
		infoText = wx.StaticText(self, -1, "%s - 0 of Unknown" % random.random())

		itemSizer.Add(infoText, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
		itemSizer.Add(subBar, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 5)

		return itemSizer


	def AddProgBar(self, event):
		print "Adding progress bar"

		self.barSizer.Add(self.__createSubBar(), 1, wx.ALL, 5)
		self.Layout()
		
class MyApp(wx.App):
	def __init__(self, redirect=False, filename=None):
		wx.App.__init__(self, redirect, filename)
		self.frame = MainFrame()

		self.frame.Show()

if __name__ == '__main__':
	app = MyApp()
	app.MainLoop()